

package com.hazelcast.internal.partition;

import com.hazelcast.internal.nio.BufferObjectDataOutput;
import com.hazelcast.spi.impl.operationservice.Operation;

import java.util.Iterator;
import java.util.function.Predicate;

/**
 * An iterator over collection of {@link Operation} which has
 * ability to be signaled to indicate end of iteration.
 *
 * @see ChunkedMigrationAwareService
 * @see com.hazelcast.spi.properties.ClusterProperty#PARTITION_CHUNKED_MIGRATION_ENABLED
 * @see com.hazelcast.spi.properties.ClusterProperty#PARTITION_CHUNKED_MAX_MIGRATING_DATA_IN_MB
 */
public interface ChunkSupplier extends Iterator<Operation> {

    /**
     * @param isEndOfChunk {@link Predicate} to test end of chunk.
     */
    default void signalEndOfChunkWith(Predicate<BufferObjectDataOutput> isEndOfChunk) {

    }
}
